/**
 * 
 */
package org.cuatrovientos.erp.model;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.format.annotation.DateTimeFormat.ISO;

/**
 * @author pablo_guerrero
 *
 */
public class Employee {
	@Min(value=1,message="{employee.id.error}")
	private int id;
	
	@NotNull(message="{employee.name.error}")
	private String name;
	
	@DateTimeFormat(iso=ISO.DATE)
	private java.sql.Date birthdate;
	
	@Pattern(regexp="^\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})$", message="{employee.phone.error}")
	private String phone;
	
	/**
	 * Default constructor
	 */
	public Employee(){
		
	}
	
	/**
	 * Constructor
	 * @param id
	 * @param name
	 * @param birthdate
	 * @param phone
	 */
	public Employee(int id, String name, java.sql.Date birthdate, String phone){
		this.id = id;
		this.name = name;
		this.birthdate = birthdate;
		this.phone = phone;
	}

	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the birthdate
	 */
	public java.sql.Date getBirthdate() {
		return birthdate;
	}

	/**
	 * @param birthdate the birthdate to set
	 */
	public void setBirthdate(java.sql.Date birthdate) {
		this.birthdate = birthdate;
	}

	/**
	 * @return the phone
	 */
	public String getPhone() {
		return phone;
	}

	/**
	 * @param phone the phone to set
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

}
